create database FACTORY; use FACTORY; create table Workspace( WID int auto_increment primary key, Descr varchar(100) not null, AreaSM decimal not null, Location varchar(50) not null); create table Worker( Ssn varchar(9) primary key, WName varchar(100) not null, Position varchar(25) not null, Salary FLOAT not null, Starting_Date date not null); create table Equipment( EID int primary key, EName varchar(100) not null, EClass varchar(25) not null, Worth float not null); create table Inventory( WID int, EID int, Quantity int not null, foreign key(WID) references Workspace(WID), foreign key (EID) references Equipment(EID) on update cascade on delete restrict); create table Trainings( Ssn char(9), EID int, Certified boolean not null, foreign key (Ssn) references Worker(Ssn), foreign key (EID) references Equipment(EID) on update cascade on delete restrict); //QUERY STATEMENTS create queries for factory database that return the following: Question 1: find the ids and descripions of all workspaces that are equipped with at least 3 of a piece of equipment named "PMOX Power Press" select ws.WID FROM Workspace AS ws JOIN Inventory AS i ON i.WID=ws.WID JOIN Equipment AS e ON i.EID=e.EID WHERE count(e.EID)>=3 AND EName='PMOX Power Press'; Question 2: Pairing of every employee name with the name of each piece of equipment he/she is trained in using. If he or she has no training, his/her name should appear once alongside a NULL VALUE. select w.WName, e.EName FROM Worker AS w JOIN Training AS t ON w.Ssn=t.Ssn JOIN Equipment AS e ON e.EID=t.EID; Question 3: Compute the sum of all worker salaries, and display it so that every thoustands-place is separated by commas(i.e.$1 million would be displayed as 1,000,000.00) select SUM(CAST(Salary AS MONEY)) FROM Worker; Question 4: Find the total count of all employees with certified training(Certified=true) in using the piece of equipment named "Kaamon ASP'. select COUNT(w.Ssn) FROM Worker AS w JOIN Training AS t ON w.Ssn=t.Ssn JOIN Equipment AS e ON e.EID=t.EID WHERE t.Certified ='true' AND EName='Kaamon APS'; Question 5: Find the description and area of all workspaces with larger area than the overall average, sorted in descending order by area. SELECT Descr AS "Space_Description", AreaSM AS "Area Per SqMtr" FROM Workspace WHERE AreaSM>(select avg(AreaSM) from Workspace) ORDER by AreaSM DESC;